import React from 'react';
import './index.less';
import { NavLink } from 'umi';
import { NAV_CONFIG } from '@/constant/route.const';

const HeaderLayout: React.FC = (props) => {
  const Navs = NAV_CONFIG.map((item) => {
    return (
      <div key={item.title + item.path}>
        <NavLink to={item.path}>{item.title}</NavLink>
      </div>
    );
  });
  return (
    <div>
      <header className={'headerLayout'}>{Navs}</header>
      <div>{props.children}</div>
    </div>
  );
};

export default HeaderLayout;
